<?php

require_once 'common/conn.php';
require_once 'common/common.php';

$db = new DBC();
$sql = "SELECT * FROM t_suggest";
$sql = "SELECT p.*,d.* FROM t_suggest d,t_product p WHERE d.code = p.flashcode";
$data = $db->fetchData($sql);
$url = "http://www.lz06.com/admin/";
if (checkArrayNotEmpty($data)) {
    for ($i = 0; $i < count($data); $i++) {
        if ($data[$i]['imageURL'] == null || $data[$i]['imageURL'] == "null" || $data[$i]['imageURL'] == "") {
            $data[$i]['imageURL'] = "";
        } else {
            $data[$i]['imageURL'] = $url . $data[$i]['imageURL'];
        }
    }
}
echo json_encode($data);
?>